<script setup>

import { ref } from 'vue'
//根据后端返回的数据去定义
const articles = ref([
    {
        "id": "1",
        "title": "1",
        "content":"1",
        "user": "1",
        "userid":"1",
        "createTime": "1",
        "updateTime": "1"
    }
    
])
import {listservice} from "@/api/article.js"
const articlelist =async()=>{
   let result= await listservice();
   articles.value=result.data;
   
}
articlelist();
</script>
<template>
    <el-card class="page-container">
        <template #header>
            <div class="header">
                <span>文章目录</span>
                
            </div>
        </template>
        <el-table :data="articles" style="width: 100%">
            <el-table-column label="序号" width="100" type="index"> </el-table-column>
            <el-table-column label="标题" prop="title"></el-table-column>
            <el-table-column label="发布者" prop="user"></el-table-column>
            <el-table-column label="发布日期" prop="createTime"></el-table-column>
            <el-table-column label="更新日期" prop="updateTime"></el-table-column>
           
            <template #empty>
                <el-empty description="没有数据" />
            </template>
        </el-table>
    </el-card>
</template>

<style lang="scss" scoped>
.page-container {
    min-height: 100%;
    box-sizing: border-box;

    .header {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
}
</style>